<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Ingreso a la base de datos</title>
<meta http-equiv="Refresh" content="5;url=index.php">
</head>

<body>
<?php 
    $a=$_POST[select1];
    $b=$_POST[select2];
        
	mysql_connect("localhost", "root", "favirguezc") or
    die("No se pudo conectar: ".mysql_error());
	mysql_select_db("ieee");
        $resultado=mysql_query("INSERT INTO MATRICULAS(PER_ID,GRU_ID,MAT_FECHA) VALUES ('$a','$b','2012-12-6 10:00:00')");
	if(mysql_error()){
		echo "<script> 
                        alert('Error al ingresar los datos'); 
                        location.href='/base-final/index.html';
                        </script>";
		}
	else{
		echo "<script> 
                        alert('Datos ingresados Correctamente.');
                        location.href='/base-final/index.html';
                        </script>";
		}
	
?>

</body>
</html>
